package com.renjiyue;

import com.renjiyue.config.MyConfig;
import com.renjiyue.pojo.Dog;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class tset01 {
    @Test
    public void test02(){
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(MyConfig.class);
        Dog dog = (Dog)applicationContext.getBean("dog");
        System.out.println(dog.name);

        Dog dog1 = (Dog)applicationContext.getBean("dog01");
        System.out.println(dog1.name);
    }
}
